﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI.WebControls;

namespace EFFC.Net.Parameters
{
    /// <summary>
    /// 文件上傳的標準化參數定義
    /// </summary>
    [Serializable]
    public class FileUpLoadParameters : ParametersStd
    {
        public FileUpLoadParameters()
        {
            AddPElement("PostFile", typeof(HttpPostedFile));
            AddPElement("FileName");
        }
        public FileUpLoadParameters(FileUpload fileControl)
        {
            AddPElement("PostFile", typeof(HttpPostedFile));
            AddPElement("FileName");
            PostFile = fileControl.PostedFile;
            FileName = fileControl.FileName;
        }
        /// <summary>
        /// 上傳獲得的文件內容
        /// </summary>
        public HttpPostedFile PostFile
        {
            get { return GetValue<HttpPostedFile>("PostFile"); }
            set { SetValue("PostFile", value); }
        }
        /// <summary>
        /// 上傳的文件名稱
        /// </summary>
        public string FileName
        {
            get { return GetValue<string>("FileName"); }
            set { SetValue("FileName", value); }
        }
    }
}
